package com.sxx.beautifulcity.database;

import com.sxx.beautifulcity.entity.greendao.KeepHealthDaoEntity;
import com.sxx.beautifulcity.entity.greendao.KeepHealthDaoEntityDao;

import java.util.List;

/**
 * Created by dllo on 15/11/2.
 */
public class KeepHealthHelper {

    private DaoSingleton instance = DaoSingleton.getInstance();
    private KeepHealthDaoEntityDao daoEntity;

    public KeepHealthHelper(){
        this.daoEntity = instance.getKeepHealthDao();
    }

    public void saveKeepHealthList(List<KeepHealthDaoEntity> keepHealthEntities){
        daoEntity.insertInTx(keepHealthEntities);
    }

    public void deleteKeepHealthList(List<KeepHealthDaoEntity> daoEntities){
        daoEntity.deleteAll();
    }

    public List<KeepHealthDaoEntity> queryKeepHealthListAll(){
        return daoEntity.loadAll();
    }
}
